﻿using System;
using System.Runtime.Serialization;
using DomainModels.DomainModels.JsonModels;

namespace DHelpers.Exceptions
{
    [Serializable]
    public class JsonAppException : Exception
    {
        public Error ErrorResponse { get; private set; }

        public JsonAppException()
        {
        }

        public JsonAppException(Error error)
            : base(error.error_msg)
        {
            ErrorResponse = error;
        }

        public JsonAppException(string message)
            : base(message)
        {
        }

        public JsonAppException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        protected JsonAppException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}